﻿<%@ Page Language="C#"  %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>后台管理入口</title>       
    <script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <link href="Styles/style.css" rel="stylesheet" type="text/css" />
    <style>

.F1 {filter: glow(Color=#FF8000,Strength=10);
     width=150px;
     height=100px;}
     
.F2 {filter: glow(Color=#00FF00,Strength=9);
     width=110px;
     height=100px;}
     
.F3 {filter: glow(Color=#0080FF,Strength=12);
     width=90px;
     height=100px;}
     
</style>
</head>
<body  onload="doThing()">
<script>
    var rate = 500


    // do not edit below this line
    // ============================

    var i = 0
    var F = 'F1'
    function doThing() {
        if (document.getElementById && document.all) {
            ok = true
            i++;
            if (i == 1) F = 'F1'
            if (i == 2) F = 'F2'
            if (i == 3) F = 'F3'
            YammaYamma.className = F
            if (i > 2) i = 0
            timer = setTimeout('doThing()', rate)
        }
    }

</script>




 

    <form id="form" action="">
    <div style="width:500px; margin: 0px auto; border:3px dashed yellow; vertical-align:middle; top:200px; position:relative;  padding-top:5px; padding-bottom:5px;">
        <table  style="border:15px solid yellow;margin:0px auto;">
           <tr style="line-height:20px;">
                <td  colspan="2" align="center" style="font-size:large;">
                 <font face="Courier" size="8" color="#FFFFFF">
        <p id="YammaYamma">
        <b>后台登录入口...</b>
        </p>
        </font>
                </td>
            </tr>
            <tr>
                <td>
                    用户名：
                </td>
                <td>
                    <input type="text" name="username" id="username" value=""  />
                </td>
            </tr>
            <tr>
                <td>
                    密 码：
                </td>
                <td>
                    <input type="password" name="password" id="password" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" value="登录" id="btnlogin"  style="border:1px solid yellow; background:yellow;"/></td>
            </tr>
        </table>
    </div>
    </form>
    <script type="text/javascript">
        $(function () {

            $("#username").blur(function () {
                if ($(this).val().length == 0) {
                    if (!$(this).hasClass("error")) {
                        $("<span/>").attr("id", "msguser").css("color", "red").css("font-size", "12px").html("请输入用户名！").insertAfter($("#username"));
                        $(this).addClass("error");
                    }
                } else {
                    $(this).next("#msguser").remove();
                    $(this).removeClass("error");
                }
            })
            $("#password").blur(function () {
                if ($(this).val().length == 0) {
                    if (!$(this).hasClass("error")) {
                        $("<span/>").attr("id", "msgpwd").css("color", "red").css("font-size", "12px").html("请输入密码！").insertAfter($("#password"));
                        $(this).addClass("error");
                    }
                } else {
                    $(this).next("#msgpwd").remove();
                    $(this).removeClass("error");
                }
            })

            $("#btnlogin").click(function () {
                if (!$("#username").hasClass("error") && !$("#password").hasClass("error") && $("#username").val().length > 0 && $("#password").val().length > 0) {
                    $.post(
                    "handler/adminHandler.ashx?t=" + new Date(),
                    { username: escape($("#username").val()), password: escape($("#password").val()) },
                    function (data) {
                        if (data != "0") {                         
                            location.href = data;
                        } else {
                            alert("用户名或密码错误！");
                        }
                    })
                }
            });
        })
    </script>
</body>
</html>
